const Sequelize=require('sequelize')
module.exports=(sequelize,DataTypes)=>{
const Model = Sequelize.Model;
class User extends Model {}
User.init({
  // attributes
  email: {
    type: Sequelize.STRING,
    unique:true,
    validate:{
      isEmail:true
    }
  },
  password: {
    type: Sequelize.STRING,
    validate:{
      len:[8,16]
    }
    // allowNull defaults to true
  },

}, {
  sequelize,
  timestamps: false,
  modelName: 'User'
  // options
});
return User
}